import { IconFont } from "@nutui/icons-react-taro"
import { Avatar, TextArea,Input } from "@nutui/nutui-react-taro"
import {  View } from "@tarojs/components"
import { useLoad } from "@tarojs/taro"
import { CSSProperties, useState } from "react"

definePageConfig({
    navigationBarTitleText: '编辑资料'
})
export default function editAcc() {
    useLoad((opsetion) => {

        setAccInfo( opsetion )
    })
    const [accInfo, setAccInfo] = useState<any>({})
    const avasty:CSSProperties={
        padding: '60rpx auto 20rpx auto',
        marginTop:'80rpx',
        left: '50%',
        transform: 'translate(-50%)'
    }
    return (
        <View>
            <Avatar
                style={avasty}
                size="80"
                src={accInfo.avatarUrl}
            />
 <IconFont fontClassName="icon-huantouxiang" classPrefix="iconfont" color="#2A2B30" size={18} style={{
        position:'absolute',
        top: '200rpx',
        right: '320rpx',
        zIndex:10
 }} />
            <View
            >昵称<Input value={accInfo.nickname} 
               style={{
                //@ts-ignore
                '--nutui-input-font-size':'$font-size-md',
                display:'inline-block',
                       }}
            onChange={(v)=>{
                setAccInfo({...accInfo, nickname: v})
            }}></Input></View>
            <View style={{marginTop:'20rpx'}}>个性签名</View>
            <TextArea value={accInfo.sign||''}
            style={{
                //@ts-ignore
                marginTop:'20rpx',
                fontSize:'28rpx'
            }}
            onChange={(v)=>{
                setAccInfo({...accInfo, sign: v})
            }}></TextArea>
        </View>
    )
}